-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repo gc
in ipfs proxy
#961
Conversation
Looking at https://github.com/ipfs/go-ipfs-cmds/blob/master/http/responseemitter.go
worth adding these in proxy responses as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test for stream-errors=false checking that the Trailer is set correctly is missing.
|
||
proxy.setHeaders(w.Header(), r) | ||
|
||
w.Header().Set("Trailer", "X-Stream-Error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to add this to the add
handler, I think. It's a bug (new PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding to all requests.
api/ipfsproxy/ipfsproxy.go
Outdated
@@ -692,6 +701,11 @@ func (proxy *Server) repoGCHandler(w http.ResponseWriter, r *http.Request) { | |||
} | |||
} | |||
} | |||
|
|||
if !streamErrors && len(errs) != 0 { | |||
w.Header().Set("X-Stream-Error", ipfsrepo.NewMultiError(errs...).Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not require all go-ipfs module to re-use a tiny method. Cluster should not depend on go-ipfs.
copy NewMultiError from go-ipfs, go mod tidy
Seems like you can't check names of Trailers in w.Header() like every other headers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you can't check names of Trailers in w.Header() like every other headers.
I'm not sure, is this a problem here?
Nope, It is not a problem. You can check if trailer header was set by checking response.Trailer |
@kishansagathiya can you send a PR for https://cluster.ipfs.io/documentation/reference/proxy/ |
No description provided.